package com.hisense.ovcloud.common3.tools;

import io.micrometer.common.util.StringUtils;
import org.springframework.web.reactive.function.server.ServerRequest;

public class ZCServerRequestUtil {
    public static String getHeader(ServerRequest req, String headerName){
        String headerVal = req.headers().firstHeader(headerName);
        if(StringUtils.isNotEmpty(headerVal)){
            return headerVal;
        }else{
            throw new RuntimeException(String.format("header %s should not be empty!", headerName));
        }
    }
}
